﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LynxBlogAPI.Models.Mapping
{
    public class PostDataMap : EntityTypeConfiguration<PostData>
    {
        public PostDataMap()
        {
            this.HasKey(t => t.postid);

            this.Property(t => t.postid).HasColumnName("PostId").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(t => t.blogid).HasColumnName("BlogId").HasMaxLength(50).IsRequired();
            this.Property(t => t.title).HasColumnName("Title").HasMaxLength(150).IsRequired();
            this.Property(t => t.description).HasColumnName("Description").IsRequired();
            this.Property(t => t.mt_text_more).HasColumnName("Mt_Text_More");
            this.Property(t => t.mt_keywords).HasColumnName("Mt_Keywords").HasMaxLength(50);
            this.Property(t => t.wp_slug).HasColumnName("WP_Slug").HasMaxLength(150);
            this.Property(t => t.mt_basename).HasColumnName("Mt_Basename").HasMaxLength(150);
            this.Property(t => t.mt_excerpt).HasColumnName("Mt_Excerpt").HasMaxLength(250);
            this.Property(t => t.wp_author_id).HasColumnName("WP_Author_Id").HasMaxLength(50);
            this.Property(t => t.IsPublished).HasColumnName("IsPublished").IsRequired();
            this.Property(t => t.dateCreated).HasColumnName("DateCreated").IsRequired();
            this.Property(t => t.license).HasColumnName("License").HasMaxLength(20);
            this.Property(t => t.commentsclosed).HasColumnName("CommentsClosed").IsRequired();
            this.ToTable("tblPostData");

        }
    }
}